package com.bootdo.front.vo;

import com.bootdo.common.utils.R;

public class Result {

   private int code;
   private String msg;
   private Object data;

   public static Result ok(){
       Result result = new Result();
       result.setCode(0);
       result.setMsg("success");
       return result;
   }

    public static Result ok(Object data){
        Result result = ok();
        result.setData(data);
        return result;
    }
    public static Result error() {
        return error("");
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.setCode(-1);
        result.setMsg(msg);
        return result;
    }

    public static Result error(int code,String msg) {

        Result result=  error(msg);
        result.setCode(code);
        return result;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
